///This page show all the 'Link-To-Us' entries, in a grid with paging limited to 30
///Author   : Kajal Mandal
///Date     : 2 April 2007
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SiteManager;

public partial class LinkToUs : System.Web.UI.Page
{   
    /// <summary>
    /// The Page Load Event
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    /// <remarks>
    /// Author  : Kajal Mandal
    /// Date    : 2 April 2007
    /// </remarks>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //Code Comment By Prashant 27/07/2007
            //BindGrid();
            //Comment Ended

            //pagingResources.PageSize = 10;
        }
    }

    /// <summary>
    /// Binds the data-grid.
    /// </summary>
    /// <remarks>
    /// Author  : Kajal Mandal
    /// Date    : 2 April 2007
    /// </remarks>
    private void BindGrid()
    {
        Manager mgr = new Manager(true,"ConnectionString");

        DataSet ds;

        ds = new DataSet();
        //Code Comment By Prashant 27/07/2007
        //ds = mgr.ExecuteQuery("select sno,url,title,description from tbl_linktous where isdelete=0 and status='A'", "tbl");
        //Comment Ended
        ds = mgr.ExecuteQuery("get_Resources", "tbl_linktous");
        grdResource.DataSource = ds;
        grdResource.DataBind();
        return;
    }

    /// <summary>
    /// Page Change Event
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    /// <remarks>
    /// Author  : Kajal Mandal
    /// Date    : 2 April 2007
    /// </remarks>
    protected void grdResource_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        //Code Comment By Prashant 27/07/2007
        //grdResource.PageIndex = e.NewPageIndex;
        //BindGrid();
        //Comment Ended
    }
    protected void grdResource_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        //LinkButton lnk;
        //lnk = (LinkButton)e.Row.FindControl("lnkTitle");
        //if (lnk != null)
        //{
        //    lnk.Attributes.Add("onclick", "window.open('" + ((lnk.CommandArgument.IndexOf(@"http://") == 0) ? lnk.CommandArgument : @"http://" + lnk.CommandArgument) + "');return false;"); 
        //}
    }
    protected void grdResource_RowCommand(object sender, GridViewCommandEventArgs e)
    {}
}
